package com.inspectortime.domain.util;

import java.util.Comparator;

import com.inspectortime.domain.Inspection;

/**
 * For sorting Inspections.  Compares inspections by inspector company id
 * 
 * @author bones
 *
 */
public class InspectionInspectorCompanyIdComparator implements Comparator {
	
	public int compare(Object arg1, Object arg2) {
		
		Inspection inspection1 = (Inspection) arg1;
		Inspection inspection2 = (Inspection) arg2;
		
		String name1 = inspection1.getInspector().getCompany().getId().toString();
		String name2 = inspection2.getInspector().getCompany().getId().toString();
		
		return name1.compareToIgnoreCase(name2);
		
	}

}
